<?
require 'global.php';
$url='member';

if($customer_id==0) { header('Location:login.html'); exit; }
$info=$i=$customer->get_row($customer_id);

$gee=$sales_order = new DB(Tsales_order,$conn);
$sales_order_detail = new DB(Tsales_order_detail,$conn);

// 处理中订单, not delivered
$where=array();
$where[]=array('name'=>'customer_id','val'=>$customer_id);
$where[]=array('name'=>'order_status','val'=>5, 'opn'=>'<');
$tem=$gee->get_rows_advanced(10240,$where);
$num_handling_order=count($tem);

// 待评价商品, items need review
$where=array();
$where[]=array('name'=>'customer_id','val'=>$customer_id);
$where[]=array('name'=>'order_status','val'=>6, 'opn'=>'<');
$where[]=array('name'=>'order_status','val'=>0, 'opn'=>'>');
$tem=$gee->get_rows_advanced(10240,$where);
$in_array=array();
if(count($tem)>0){
	foreach($tem as $val) $in_array[]=$val['id'];
}

$num_need_review_item=0;
$where=array();
$where[]=array('name'=>'is_reviewed','val'=>0);
$where[]=array('name'=>'sales_order_id','val'=>$in_array, 'opn'=>'in');
$tem=$sales_order_detail->get_rows_advanced(10240,$where);
$num_need_review_item=count($tem);

// SEO 
$cate_name=WEB_MEMBER_CENTER;
$title=$cate_name.' - '.$config['SITE_COMPANY_'.LANG];
$dpn=$kwd=$title;

// view 加载视图
require VIEW.$url.'.php';

// end of file
